package com.gitee.qdbp.general.trade.api.order.main.service;

import java.util.List;
import com.gitee.qdbp.able.exception.ServiceException;
import com.gitee.qdbp.base.system.model.IAccount;
import com.gitee.qdbp.general.trade.api.order.main.model.OrderFormBean;
import com.gitee.qdbp.general.trade.api.order.main.model.OrderItemBase;

/**
 * 订单主管理接口
 *
 * @author zhh
 * @version 170701
 */
public interface IOrderMainExecutor {

    /** 创建实物订单 **/
    String create(OrderFormBean orderForm, List<OrderItemBase> orderItems, IAccount operator) throws ServiceException;

    /** 创建服务订单(没有明细) **/
    default String create(OrderFormBean orderForm, IAccount operator) throws ServiceException {
        return this.create(orderForm, null, operator);
    }

    /** 修改订单金额(总金额和运费) **/
    void updateAmount(String orderId, Double totalAmount, Double freightAmount, IAccount operator)
            throws ServiceException;

    /** 取消订单(待支付变成已取消) **/
    void cancel(String orderId, IAccount operator) throws ServiceException;

    /** 删除无效订单 **/
    void deleteIneffectiveRecord(String orderId, IAccount operator) throws ServiceException;

    /** 删除有效订单 **/
    void deleteEffectiveRecord(String orderId, IAccount operator) throws ServiceException;

    /** 订单发货(发货给快递公司) **/
    void deliverByCarrier(String orderId, int deliverQuantity, String newQueryKeywords) throws ServiceException;
}
